package cn.tedu.straw.portal.mapper;

import cn.tedu.straw.commons.model.UserCollection;
import cn.tedu.straw.commons.vo.UserCollectionVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tedu.cn
 * @since 2020-07-30
 */
@Repository
public interface UserCollectionMapper extends BaseMapper<UserCollection> {
    /**
     * 查询全部收藏
     * @param userId
     * @return
     */
    List<UserCollectionVO> findUserCollections(Integer userId);

    /**
     * 删除一条收藏
     * @param userId
     * @param questionId
     * @return
     */
    Integer deletes(Integer userId,Integer questionId);

    /**
     *  查询收藏
     * @param userId
     * @param questionId
     * @return
     */
    Integer selectByIds(@Param("userId") Integer userId,@Param("questionId")Integer questionId);



   // List<UserCollection> selectOne(QueryWrapper<List<UserCollection>> queryWrapper);
}
